<?php
declare (strict_types=1);

namespace app\index\controller;

use app\common\model\Assets;
use app\common\model\Account as AccountModel;
use app\common\tool\Result;
use think\facade\View;

class Account extends Base
{

    public function index()
    {
        View::assign('assets', Assets::getFields(3));
        return View::fetch();
    }

    public function record()
    {
        $type = $this->request->param('type');
        View::assign([
            'title' => Assets::getFields(3)[$type],
            'type'  => $type
        ]);
        return View::fetch();
    }


    public function getList()
    {
        $map = ['type' => $this->request->get()['type'], 'uid' => $this->user->id];
        return Result::fastReturn(AccountModel::getPageList($map, '*', $this->getPage(), 20, false, ['take']));

    }
}

